#ifndef PERSONMEMBER_H
#define PERSONMEMBER_H
#include <QList>
#include "person.h"

class PersonMember : public Person
{
public:
    PersonMember():Person() {}

    PersonMember(const QString membercardID, const QString memberName, const QString gender,
                 /*const QString memberLevelNumber,*/ const QString memberLevel, const QString membercardAmount,
                 const QString integration, const QString discount, const QString totalSpending,
                 const QString consumeTimes, const QString handleDate, const QString tel,
                 const QString email, const QString address, const QString memberRemark,
                 const QString membercardPassword, const QString handelStaffName)
        :Person(membercardID, memberName, gender, tel, email, address)
    {
//        m_memberLevelNumber = memberLevelNumber;
        m_memberLevel = memberLevel;
        m_membercardAmount = membercardAmount;
        m_integration = integration;
        m_discount = discount;
        m_totalSpending = totalSpending;
        m_consumeTimes = consumeTimes;
        m_handleDate = handleDate;
        m_memberRemark = memberRemark;
        m_membercardPassword = membercardPassword;
        m_handelStaffName = handelStaffName;
    }

    PersonMember(const QString membercardID, const QString memberName, const QString gender,
                 const QString tel, const QString email,
                 const QString address, const QString HandleDate, const QString MemberLevel,
                 const QString Integration, const QString Discount, const QString MemberCardAmount,
                 const QString StaffName, const QString memberPassword, const QString memberRemark,
                 const double cashPayment, const double CUPPayment)
        :Person(membercardID, memberName, gender, tel, email, address)
    {
        m_handleDate = HandleDate;
        m_memberLevel = MemberLevel;
        m_integration = Integration;
        m_discount = Discount;
        m_membercardAmount = MemberCardAmount;
        m_handelStaffName = StaffName;
        m_membercardPassword = memberPassword;
        m_memberRemark = memberRemark;
        m_cashPayment = QString::number(cashPayment);
        m_CUPPayment = QString::number(CUPPayment);
    }

    PersonMember(const QString memberLevelNumber, const QString memberLevel, const QString discount,
                 const QString membercardAmount, const QString integration)
    {
        m_memberLevelNumber = memberLevelNumber;
        m_memberLevel = memberLevel;
        m_membercardAmount = membercardAmount;
        m_integration = integration;
        m_discount = discount;
    }

    PersonMember & operator =(const PersonMember &other)
    {
        if (this == &other)
            return *this;
        Person::operator =(other);
        m_memberLevelNumber = other.m_memberLevelNumber;
        m_memberLevel = other.m_memberLevel;
        m_membercardAmount = other.m_membercardAmount;
        m_integration = other.m_integration;
        m_discount = other.m_discount;
        m_totalSpending = other.m_totalSpending;
        m_consumeTimes = other.m_consumeTimes;
        m_handleDate = other.m_handleDate;
        m_memberRemark = other.m_memberRemark;
        m_membercardPassword = other.m_membercardPassword;
        m_handelStaffName = other.m_handelStaffName;
        m_cashPayment = other.m_cashPayment;
        m_CUPPayment = other.m_CUPPayment;
        return *this;
    }

    QString get_memberLevelNumber() const {return m_memberLevelNumber;}
    QString get_memberLevel() const {return m_memberLevel;}
    QString get_membercardAmount() const {return m_membercardAmount;}
    QString get_integration() const {return m_integration;}
    QString get_discount() const {return m_discount;}
    QString get_totalSpending() const {return m_totalSpending;}
    QString get_consumeTimes() const {return m_consumeTimes;}
    QString get_handleDate() const {return m_handleDate;}
    QString get_memberRemark() const {return m_memberRemark;}
    QString get_membercardPassword() const {return m_membercardPassword;}
    QString get_handelStaffName() const {return m_handelStaffName;}
    QString get_cashPayment() const {return m_cashPayment;}
    QString get_CUPPayment() const {return m_CUPPayment;}

    void set_memberLevel(QString memberLevel)  {m_memberLevel = memberLevel;}
    void set_discount(QString discount)  {m_discount = discount;}
    void set_integration(QString integration)  {m_integration = integration;}
    void set_membercardAmount(QString membercardAmount)  {m_membercardAmount = membercardAmount;}
    void set_totalSpending(QString totalSpending)  {m_totalSpending = totalSpending;}
    void set_consumeTimes(QString consumeTimes)  {m_consumeTimes = consumeTimes;}
    void set_memberRemark(QString memberRemark)  {m_memberRemark = memberRemark;}

private:
    QString m_memberLevelNumber;
    QString m_memberLevel;
    QString m_membercardAmount;
    QString m_integration;
    QString m_discount;
    QString m_totalSpending;
    QString m_consumeTimes;
    QString m_handleDate;
    QString m_memberRemark;
    QString m_membercardPassword;
    QString m_handelStaffName;
    QString m_cashPayment;
    QString m_CUPPayment;
};

typedef QList <PersonMember> memberList;
#endif // PERSONMEMBER_H
